﻿using CrateMayhem.Common.Controls;
using CrateMayhem.WinRT.Common;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;

namespace CrateMayhem.WinRT.Controls
{
    public class Worker : UserControl, IWorker
    {
        private static readonly Brush brush;
        private static readonly Brush borderBrush;

        public Worker()
        {
            DefaultStyleKey = typeof(Worker);
            var border = new Border
                {
                    CornerRadius = new CornerRadius(20),
                    BorderThickness = new Thickness(1),
                    Width = 20,
                    Height = 20,
                    Background = brush,
                    BorderBrush = borderBrush
                };
            Content = border;
        }

        static Worker()
        {
            brush = Common.Resources.GameStyles.Get<Brush>("WorkerBackgroundBrush");
            borderBrush = Common.Resources.GameStyles.Get<Brush>("WorkerBorderBrush");
        }
    }
}